<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<html>
<head>
    <title>文章详情</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            display: flex;
            min-height: 100vh;
            background-color: #f9f9f9;
        }
        /* 左侧侧边栏 */
        .sidebar {
            width: 200px;
            background-color: #333;
            color: white;
            padding: 20px;
            box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
            display: flex;
            flex-direction: column;
        }
        .sidebar h2 {
            margin: 0 0 20px;
            text-align: center;
            color: white;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 50px;
        }
        .sidebar a {
            color: white;
            text-decoration: none;
            margin: 10px 0;
            padding: 10px;
            border-radius: 5px;
            display: block;
            background-color: #444;
        }
        .sidebar a:hover {
            background-color: #4CAF50;
        }
        /* 内容区域 */
        .content {
            flex-grow: 1;
            padding: 20px;
        }
        h1 {
            text-align: center;
            font-size: 32px;
            color: #333;
            margin-bottom: 20px;
        }
        .author-team {
            display: flex;
            justify-content: center;
            gap: 20px;
            font-size: 14px;
            color: #555;
            margin-bottom: 20px;
        }
        .abstract {
            text-align: center;
            font-weight: bold;
            font-size: 16px;
            margin-bottom: 20px;
        }
        .content-section {
            color: #555;
            line-height: 1.6;
            margin-bottom: 20px;
        }
        .footer {
            text-align: right;
            font-size: 12px;
            color: #777;
            margin-top: 20px;
        }
        /* 右下角按钮样式 */
        .floating-btn {
            position: fixed;
            bottom: 20px;
            right: 20px;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 5px;
            padding: 10px 20px;
            font-size: 14px;
            cursor: pointer;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
        .floating-btn:hover {
            background-color: #45a049;
        }
    </style>
</head>
<body>

    <!-- 左侧按钮区域 -->
    <div class="sidebar">
        <h2>功能导航</h2>
        <a href="/interactiveFeature">互动功能</a>
        <a href="/dashboard">返回</a>
        <a href="/login">登录</a>
        <a href="/logout">退出登录</a>
    </div>

    <!-- 右侧内容区域 -->
    <div class="content">
        <h1>${article.title}</h1>

        <!-- 作者和团队 -->
        <div class="author-team">
            <p><strong>作者：</strong>${user.name}</p>
            <p><strong>团队：</strong>${team.teamName}</p>
        </div>

        <!-- 文章摘要 -->
        <p class="abstract"><strong>文章摘要：</strong>${article.abstractText}</p>

        <!-- 文章内容 -->
        <div class="content-section">
            <p>${article.content}</p>
        </div>

        <!-- 附件链接 -->
        <p><strong>附件链接：</strong>
            <c:if test="${article.attachmentLink != null}">
                <!-- 使用 URL 编码处理文件路径 -->
                <a href="/download?filePath=${fn:escapeXml(article.attachmentLink)}">${AttachmentLink}</a>
            </c:if>
        </p>
        <!-- 发表日期 -->
        <div class="footer">
            <p><strong>发表日期：</strong>${article.publishDate}</p>
        </div>

        <!-- 右下角按钮 -->
        <button class="floating-btn" onclick="window.location.href='/interactiveFeature';">反馈</button>
    </div>

</body>
</html>
